// app.js
App({
  onLaunch() {
    const accountInfo = wx.getAccountInfoSync();
    switch (accountInfo.miniProgram.envVersion) {
      case 'develop': // 开发版
        this.globalData.BaseUrl = 'https://gatewaytest.tongdow.com/api/v1';
        this.globalData.wsUrl = 'wss://gatewaytest.tongdow.com/api/v1/ws';
        break;
      case 'tral': // 体验版
        this.globalData.BaseUrl = 'https://gatewaytest.tongdow.com/api/v1';
        this.globalData.wsUrl = 'wss://gatewaytest.tongdow.com/api/v1/ws';
        break;
      case 'release': // 正式版
        this.globalData.BaseUrl = 'https://gateway.tongdow.com/api/v1';
        this.globalData.wsUrl = 'wss://gateway.tongdow.com/api/v1/ws';
        break;
    }
  },
  globalData: {
    userInfo: null,
    userService: null,
    token: null,
    BaseUrl: '',
    wsUrl: '',
    menuList: [],
    currentMenuItem: null,
    currentProvince: null,
    lastLoginInfo: null,
  },
})
